<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

get_header();


?>
<!--	<div class="cDivWrapper">-->
	<div class="cDivHomeContainer">
		<?php
			$sMetaSlug = 'ai_home_page_introduction';
			$sHomeIntro = ot_get_option($sMetaSlug);
			if ($sHomeIntro != '') :
		?>
		<!-- <div class="cDivTitleWrapper"> -->
			<!-- <h3><?php //echo get_the_title(); ?></h3> -->
			<!-- <div class="cDivRedLine"></div> -->

		<!-- </div> -->
		
		<div class="cDivContent">
			<?php echo $sHomeIntro; ?>
			<div class="cDivQuoteRight"></div>
		</div>
		

		<?php endif;?>
		
	</div>

	<div class="cDivServicesWrapper">
		<div class="cDivVerticalLineFull"></div>
		
		<div class="cDivServicesItemsContainer">
			<div class="cDivTitleWrapper">
				<h3>Services</h3>
				<div class="cDivRedLine"></div>
			</div>

		<?php
			$oServices = ai_get_service_for_home();
			if ($oServices != null) :
				$iCounter = 1;
				while($oServices->have_posts()) : $oServices->the_post();
			?>
				<div class="cDivServiceItem <?php echo ($iCounter == 2) ? 'cLast' : ''; ?>">
					<div class="cDivItemTitle">
						<?php echo get_the_title(); ?>
					</div>
					<div class="cDivItemPrice">
                         <?php echo get_field('aiServicePrice');?> 
                            <br>
	                        <span class="cSpanNumberofWords"> <?php echo get_field('aiServiceNumberWords');?></span>
					</div>
					<?php
						$sOnelineInfo = get_field('aiOneLineIntro');
						if ($sOnelineInfo != '') {
							$aOnelineInfo = explode('<br />', $sOnelineInfo);
							
							foreach ($aOnelineInfo as $key => $sValue) { 
								if ($sValue != ' ' && isset($sValue) && !ctype_space($sValue) ) {
							?>
									<div class="cDivItem <?php echo (($key % 2) == 0) ? 'cDivItemOne' : 'cDivItemTwo';?>">
										<?php 
											echo '<span class="cSpanMark"></span>'. $sValue;
											// var_dump($sValue);
										?>
									</div>											
							<?php
								} // end $sValue '' check
							 } // foreach
						}
						// var_dump($sOnelineInfo);
					?>
					<div class="cDivItem cDivItemOne cDivItemLinkContainer">
						<a class="cAMoreInfo" href="<?php echo get_post_type_archive_link('service');?>">More Info</a>
					</div>

				</div> <!-- cDivServiceItem --> 

		<?php 
				$iCounter++;
				endwhile;
			endif;
 		?>

		</div> <!-- cDivServicesItemsContainer --> 

		<!-- <div class="cDivVerticalSeperator"></div> -->

		<div class="cDivWhyUseContainer">
			<?php
				$oPage = ai_get_single_page('why-use');
				if ($oPage != null) :
					$oPage->the_post();
			?>
			<div class="cDivTitleWrapper">
				<h3><?php echo get_the_title(); ?></h3>
				<div class="cDivRedLine"></div>

			</div>

			<div class="cDivContent">
				<?php the_content(); ?>
			</div>

			<?php endif;?>
		
		</div> <!-- cDivWhyChooseUsContainer -->

		<div class="cClearBoth"></div>
	</div>

<!--	<div class="cClearBoth"></div>-->


	<div class="cDivServicesWrapper">

		<div class="cDivServiceFormContainer">
			<div class="cDivTitleWrapper">
				<h3>Send Us Your Work</h3>
				<div class="cDivRedLine"></div>
			</div>

			<div class="cDivFormContainer" id="iDivFormManager">
				<form name="cvManager" action="<?php echo admin_url('admin-ajax.php');?>" id="iFormCvManager" method="post" enctype="multipart/form-data">
					<div class="cDivElementContainer">
						<label class="cLabelFormManager">Name</label>
						<input type="text" name="textName" />
						<span class="cSpanError"></span>
					</div>

					<div class="cDivElementContainer">
						<label class="cLabelFormManager">Email</label>
						<input type="text" name="textEmail" />
						<span class="cSpanError"></span>

					</div>

					<div class="cDivElementContainer">
						<label class="cLabelFormManager">Upload CV</label>
						<input type="file" name="fileCv" /><br>
						<span class="cFileElementError"></span>

					</div>

					<div class="cDivElementContainer">
						<label class="cLabelFormManager">Comments</label>
						<textarea cols="20" rows="5" name="textareaComments" ></textarea>
						<span class="cTextareaElementError"></span>

					</div>

					<div class="cDivElementContainer">
						<input type="submit" value="Submit" class="cSubmitCvManager"/>
						<div class="cClearBoth"></div>
					</div>

				</form>

			</div>
		</div>

		<!-- <div class="cDivVerticalSeperatorForm"></div> -->

		<div class="cClearBoth"></div>
	</div> <!-- cDivServicesWrapper -->

	<div class="cDivAboutUsBg">
		<div class="cDivAboutUsWrapper">
			<div class="cDivTitleWrapper">
				<h3>About Us</h3>
				<div class="cDivRedLine"></div>
			</div>

			<div class="cDivAboutUsContent">
				<?php
					$oPagePost = ai_get_about_us();
					if ($oPagePost != null) {
						$oPagePost->the_post();
						echo get_the_excerpt();
					}

				?>
				<a href="<?php echo bloginfo('url');?>/about-us" class="cAMoreInfo cAAboutUs">Read More</a>
				<div class="cClearBoth"></div>
			</div>
		</div>
            
	</div> <!-- cDivAboutUsBg -->

	<div class="cClearBoth"></div>

	<div id="iDivBlockUiMessage" style="display:none;">
		<h1>We are processing your request.  Please be patient.</h1>
	</div> <!-- domMessage -->
    
    <div class="cDivFbLikeContainer" style="display:none;">
        <div class="cDivFbLikeWrapper">
        <fb:like href="https://www.facebook.com/SachinTendulkar"
                 layout="button_count"
                 show-faces="false"
                 width="100"
                 action="like"
                 colorscheme="light" />
        
        </div>
    </div>

<?php
	get_footer();
?>
    </body>
</html>